use crate::dao;
use crate::runtime::response::MagicBoxResponse;
use crate::runtime::result::MagicBoxResult;

#[tauri::command(rename_all = "snake_case")]
pub(crate) async fn invoke_set_setting(name: String, value: String) -> MagicBoxResult<MagicBoxResponse<()>> {
    dao::setting::set_setting(name.as_str(), value.as_str())?;

    Ok(MagicBoxResponse::new_empty_success())
}